package com.pri.chat.adapter;

import android.widget.ImageView;
import android.widget.LinearLayout;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.netease.nim.uikit.R;
import com.netease.nim.uikit.business.GiftBean;
import com.netease.nim.uikit.net.entity.VideoGiftBean;


/**
 * 类描述：礼物适配器
 */
public class GiftListAdapter extends BaseQuickAdapter<VideoGiftBean, BaseViewHolder> {
    private int mHeiht;
    public GiftListAdapter(int layoutResId, int with) {
        super(layoutResId);
        this.mHeiht = with;
    }

    @Override
    protected void convert(BaseViewHolder helper, VideoGiftBean item) {
        LinearLayout llgift = helper.getView(R.id.ll_gift);
        LinearLayout.LayoutParams params= (LinearLayout.LayoutParams) llgift.getLayoutParams();
        params.height= mHeiht;//设置当前控件布局的高度
        llgift.setLayoutParams(params);
        helper.setText(R.id.tv_gift_number,item.getPrice()+"金币");
        String giftName = item.getName();
        helper.setText(R.id.tv_gift_name,giftName);
        Glide.with(mContext).load(item.getImagePath()).into((ImageView) helper.getView(R.id.iv_gift));


    }
}
